# $Id: PKGBUILD 150540 2012-02-18 12:17:15Z pierre $
# Maintainer:
# Contributor: dorphell <dorphell@archlinux.org>

pkgname=libid3tag
pkgver=0.15.1b
pkgrel=7
pkgdesc="library for id3 tagging"
arch=('i686' 'x86_64')
url="http://www.underbit.com/products/mad/"
license=('GPL')
depends=('zlib')
makedepends=('gperf')
options=('!libtool')
source=("ftp://ftp.mars.org/pub/mpeg/${pkgname}-${pkgver}.tar.gz"
	'id3tag.pc'
	'10_utf16.diff' '11_unknown_encoding.diff' 'CVE-2008-2109.patch')
md5sums=('e5808ad997ba32c498803822078748c3'
	'8bb41fd814fafcc37ec8bc88f5545a4a'
	'4f9df4011e6a8c23240fff5de2d05f6e'
	'3ca856b97924d48a0fdfeff0bd83ce7d'
	'c51822ea6301b1ca469975f0c9ee8e34')

build() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  patch -p1 -i ${srcdir}/10_utf16.diff
  patch -p1 -i ${srcdir}/11_unknown_encoding.diff
  patch -Np0 -i ${srcdir}/CVE-2008-2109.patch

  ./configure --prefix=/usr
  make
}

package() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  make DESTDIR="${pkgdir}" install
  install -D -m644 "${srcdir}/id3tag.pc" "${pkgdir}/usr/lib/pkgconfig/id3tag.pc"
}
